#include "QWidgetofpreview.h"


QWidgetOfPreview::QWidgetOfPreview(QWidget *parent, int count) : QWidget(parent)
{
    LabelOfPic = new QLabel(this);
    BtnOfText = new QPushButton(this);
    Layout = new QVBoxLayout(this);

    BtnOfText->setFixedHeight(35);
    QString filename;

    if(count == 0)
    {
        BtnOfText->setText("暂无信息");
        filename = QString::fromUtf8(":/Preview/Image/Preview/Fault.png");
    }
    else
    {
        //如果记录了上一次的账号,此处读取上次保留的头像信息
    }

    Layout->addWidget(LabelOfPic);
    Layout->addStretch(5);
    Layout->addWidget(BtnOfText);

    PixmapOfPic = new QPixmap(filename);
    PixmapOfPic->scaled(LabelOfPic->size(),Qt::KeepAspectRatio);
    LabelOfPic->setScaledContents(true);
    LabelOfPic->setPixmap(*PixmapOfPic);
    BtnOfText->setObjectName("BtnOfText");
}
